﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VideoClub.DS.classes.sp;
using VideoClub.EN.classes;


namespace VideoClub.BS.classes
{
    public class Bs_Add
    {
        Sp_Add_Handler objaddhande = new Sp_Add_Handler();

        public int addActor(Actor actor, ref string log)
        {
            int rowsaffected = 0;
            try
            {
               rowsaffected= objaddhande.addActor(actor, ref log);
                return rowsaffected;
            }
            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }

        public int addAlquiler(Alquiler alquiler, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addAlquiler(alquiler, ref log);                                 
                    return rowsaffected;
                }
            
            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }

        public int addCategoriaPeli(CategoriaPelicula categoriapelicula, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addCategoriaPeli(categoriapelicula, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }


        public int addClasificacionPeli(ClasificacionPelicula clasificacionpeli, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addClasificacionPeli(clasificacionpeli, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }


        public int addDetalleAlquiler(DetalleAlquiler detallealquiler, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addDetalleAlquiler(detallealquiler, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }


        public int addDetalleDevolucion(DetalleDevolucion detalledevolucion, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addDetalleDevolucion(detalledevolucion, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }

        public int addDetalleSolicitud(DetalleSolicitud detallesolicitud, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addDetalleSolicitud(detallesolicitud, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }

        public int addDevolucion(Devolucion devolucion, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addDevolucion(devolucion, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }

        public int addNacionalidad(Nacionalidad nacionalidad, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addNacionalidad(nacionalidad, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }

        public int addParticipacionPelicula(ParticipacionActor participacionactorpeli, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addParticipacionPelicula(participacionactorpeli, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }


        public int addPelicula(Pelicula pelicula, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addPelicula(pelicula, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }

        public int addPeliImgFile(PeliImageFile peliimgfile, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addPeliImgFile(peliimgfile, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }


        public int addSolicitud(Solicitud solicitud, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addSolicitud(solicitud, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }


        public int addTipoUsuario(TipoUsuario tipousuario, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addTipoUsuario(tipousuario, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }


        public int addUsuario(Usuario usuario, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addUsuario(usuario, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }


        public int addVideoPelicula(VideoPelicula videopelicula, ref string log)
        {
            try
            {
                int rowsaffected = 0;
                rowsaffected = objaddhande.addVideoPelicula(videopelicula, ref log);
                return rowsaffected;
            }

            catch (Exception ex)
            {
                log += ex.Message + ex.StackTrace + ex.Source;
                throw ex;
            }
        }

               
    }
}
